# set minimum cmake version
cmake_minimum_required(VERSION 3.22 FATAL_ERROR)

# project name and language
project(luatest LANGUAGES CXX)

# require C++17
set(CMAKE_C_STANDARD 11)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
set(CMAKE_POSITION_INDEPENDENT_CODE TRUE)

cmake_policy(SET CMP0075 NEW)
cmake_policy(SET CMP0077 NEW)
set(CMAKE_POLICY_DEFAULT_CMP0077 NEW)
cmake_policy(SET CMP0135 NEW)
set(CMAKE_POLICY_DEFAULT_CMP0135 NEW)

set(MY_LIBS)
set(FETCHCONTENT_BASE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../.dep)
include(FetchContent)
include(${CMAKE_CURRENT_LIST_DIR}/../cmake/FetchLua.cmake)
FetchContent_MakeAvailable(lua)

add_executable(${PROJECT_NAME} ${CMAKE_CURRENT_SOURCE_DIR}/main.cpp ${CMAKE_CURRENT_SOURCE_DIR}/lua_help.cpp)
target_link_libraries(${PROJECT_NAME} PRIVATE lua)